1 <!-- This php file is for student login -->
2
3
4 <html>
5 <head>
6     <title> STUDENTS SPACE</title>
7     <link rel=
"stylesheet" type="text/css" href="slogincss.css" />
8     </head>
9     <body>
10         <div id=
"header1">
11     <h1> STUDENT
'S SPACE</h1></div>
12     <?php
13         session_start();
14         $id=$_SESSION[
'sid'];
15         $username=
"root";
16         $servername=
"localhost";
17         $dbname=
"studentinfo";
18         $con=mysqli_connect($servername,$username,
"",$dbname);
19         
if($con->connect_error){
20             die(
"Connection failed:"+$con->connect_error);
21         }
22         
else{
23              $t2=
"t2";
24             $sql=
"select * from student where sid=$id";
25             $result=$con->query($sql);
26             
if($result->num_rows>0){
27                $d1=
"d1";
28                 
while($row=$result->fetch_assoc()){
29                     echo
"<div id=$d1><span>ID</span>::".$row['sid']."<br><span>NAME</span>::".$row['name']."<br><span>DEPARTMENT</span>::".$row['dept']."<br><span>COLLEGE</span>::".$row['college_name']."</div>";
30                 }
31             }
32             echo
"<table id=$t2 ><tr><th>SUBJECT</th><th>UT1</th><th>UT2</th><th>UT3</th><th>INTERNAL MARK</th></tr>";
33             $sql=
"select * from cs6501 where reg_id=$id";
34             $result=$con->query($sql);
35                
36                     
if ($result->num_rows > 0) {
37                         
38                         
// output data of each row
39                         
while($row = $result->fetch_assoc()) {
40                             echo
"<tr><td>cs6501</td><td>".$row["ut1"]."&nbsp;</td>&nbsp;<td> ".$row["ut2"]."&nbsp;</td>&nbsp;<td> ".$row["ut3"]."&nbsp;</td>&nbsp;<td> ".$row["im"]."&nbsp;</td></tr>";
41                         
42                     }
43                         
44                     }
45             $sql1=
"select * from cs6502 where reg_id=$id";
46             $result1=$con->query($sql1);
47                
48                     
if ($result1->num_rows > 0) {
49                         
// output data of each row
50                         
while($row = $result1->fetch_assoc()) {
51                             echo
"<tr><td>cs6502</td>&nbsp;<td>".$row["ut1"]."&nbsp;</td>&nbsp;<td> ".$row["ut2"]."&nbsp;</td>&nbsp;<td> ".$row["ut3"]." &nbsp;</td>&nbsp;<td>".$row["im"]."&nbsp;</td></tr>";
52                         
53                     }
54                         
55                     }
56                 
57         }
58             
59         ?>
60         <button id=
"b1"><a href="index.php" style="text-decoration:none">BACK TO HOME</a></button>
61     </body>
62 </html>


Gõ tìm kiếm nhanh...